$(document).ready(function() {
	$("#depSelect").change(function() {
		$(".normalCourseRow").remove();
		var selectedIndex = $("#depSelect").prop("selectedIndex");
		for(var i = 0; i < courses[selectedIndex].length; i++) {
			var rowString = '<tr class="normalCourseRow">';
			for(var j = 0; j < courses[selectedIndex][i].length; j++)
				rowString += "<td>" + courses[selectedIndex][i][j] + "</td>"; 
			rowString += "</tr>";
			$("#coursesTable tr:last").after(rowString);
		}
	});
});